package com.satan.vote.vo;

import jakarta.servlet.http.HttpServletResponse;

/**
 * @ClassName ResCode
 * @Description TODO
 * @date 2023/6/19 15:56
 * @Version 1.0
 */
public enum ResCode {
    ACCOUNT_EXIST(10001, "账号已存在"),
    REGIST_FAILD(10001,"注册失败"),
    ACCOUNT_OR_PASSWORD_ERROR(10001,"账号或密码错误"),
    NO_LOGIN(10001,"未登录"),
    TOKEN_ERROR(10001,"token不合法"),
    LOGIN_TIME_OUT(10001,"登录过期"),
    LOGIN_TRY_AGAIN(10001,"请重新登录"),
    SYSTEM_ERRO(-999,"系统异常"),
    NO_RESULT(10001,"无返回结果"),
    NO_PRODUCT(10001,"无商品信息"),
    NO_PRODUCT_PARAMS(10001,"无商品参数信息"),
    INSERT_ERROR(10001,"数据插入失败"),
    UPDATE_ERROR(10001,"数据更新失败"),
    DELETE_ERROR(10001,"数据删除失败" ),
    STOCK_NOT_ENOUGH(10001,"商品库存不足" ),
    ORDER_ERROR(10001,"下单失败" ),
    GLOBAL_EXCEPTION(500,"全局异常"),
    AUTH_ERROR(HttpServletResponse.SC_UNAUTHORIZED,"认证失败,请登录"),
    LOGOUT_ERROR(10001,"退出登录失败");
    private int code;
    private String msg;

    ResCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
